<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <title>BC显示</title>
    <meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <!--标准mui.css-->
    <link rel="stylesheet" href="css/mui.min.css">
    <!--App自定义的css-->
    <link rel="stylesheet" type="text/css" href="css/app.css"/>

    <link href="css/mui.picker.css" rel="stylesheet"/>
    <link href="css/mui.poppicker.css" rel="stylesheet"/>
    <link href="css/baiyi.css" rel="stylesheet">
    <script src="js/angular.min.js"></script>
</head>

<body ng-app="personalCenter" ng-controller="pcCtrl">

<nav class="mui-bar mui-bar-tab">
    <a class="mui-tab-item" href="index.html">
        <span class="mui-icon mui-icon-home"></span>
        <span class="mui-tab-label">首页</span>
    </a>
    <a class="mui-tab-item" href="quotation.html">
        <span class="mui-icon mui-icon-compose"></span>
        <span class="mui-tab-label">报价单</span>
    </a>
    <a class="mui-tab-item" href="steelStruct.html">
        <span class="mui-icon mui-icon-settings"></span>
        <span class="mui-tab-label">钢结构图纸</span>
    </a>
    <a class="mui-tab-item" href="dRendering.html">
        <span class="mui-icon mui-icon-starhalf"></span>
        <span class="mui-tab-label">动态效果</span>
    </a>
    <a class="mui-tab-item mui-active">
        <span class="mui-icon mui-icon-contact"></span>
        <span class="mui-tab-label">个人中心</span>
    </a>
</nav>

<div class="mui-content">

    <div id="personalCenter" class="mui-control-content mui-active">
        <header class="mui-bar mui-bar-nav">
            <h1 class="mui-title">个人中心</h1>
            <a class="mui-pull-right headA" href="#" onclick="logout()">注销</a>
        </header>

        <div class="mui-content-padded">

            <div class="headMarginTop"></div>

            <div style="height: 70px"></div>

            <div class="alignCenter">

                <img src="img/baiyi48.png" style="border-radius:15px" class="alignCenter"><br>
                <div class="myFont">ID: {{phone}}</div>
                <div class="myFont">积分剩余：{{points}}</div>

            </div>

            <div style="height: 70px"></div>

            <div class="alignCenter">
                <div>
                    <button type="button" class="mui-btn mui-btn-success payButton">微信支付</button>
                </div>
                <div>
                    <button type="button" class="mui-btn mui-btn-primary payButton">支付宝支付</button>
                </div>
            </div>
        </div>

    </div>

</div>

</body>

<script src="js/jquery-1.9.1.min.js"></script>
<script src="js/mui.min.js"></script>
<script src="globalVar.js"></script>
<script>

    mui.init({
        swipeBack: false //启用右滑关闭功能
    });


    var app = angular.module('personalCenter', []);
    app.controller('pcCtrl', function($scope,$http) {
        $scope.width = "";
        $scope.height = "";
        $scope.modelName = "";
        $scope.token = "";
        $scope.modelId = "";

        var width = localStorage.getItem("width");
        var height = localStorage.getItem("height");
        var modelName = localStorage.getItem("modelName");
        var modelId = localStorage.getItem("modelId");

        if (width === null) {
            $scope.width = 5;
        } else {
            $scope.width = width;
        }
        if (height === null) {
            $scope.height = 5;
        } else {
            $scope.height = height;
        }
        if (modelName === null) {
            $scope.modelName = "P8";
        } else {
            $scope.modelName = modelName
        }
        if (modelId === null) {
            $scope.modelId = 1;
        } else {
            $scope.modelId = modelId
        }
        $scope.token = localStorage.getItem("token");

        $http({
            method: "GET",
            url: url + "/user/userMessage?token="+$scope.token,
        }).then(
            function success(response) {
                console.log(response.data)
                $scope.phone = response.data.obj.phone;
                $scope.points = response.data.obj.points;
            },
            function error(response) {
                location.href = "login.html";
            }
        );
    });

    //导航
    mui('body').on('click', 'a', function () {
        document.location.href = this.href;
    });

    function logout() {
        localStorage.setItem("modelName", "");
        localStorage.setItem("modelId", "");
        localStorage.setItem("width", "");
        localStorage.setItem("height", "");
        localStorage.setItem("token", "");
        window.location.href = "login.html";
    }



</script>
</html>